package com.example.peibei.ui.utils;

import android.content.Context;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.example.peibei.R;

public class LevelImage {
    public static void setLevelImage(int level, ImageView head) {
        switch (level) {
            case 0:
                head.setBackgroundResource(R.mipmap.level_one);
                break;
            case 1:
                head.setBackgroundResource(R.mipmap.level_two);
                break;
            case 2:
                head.setBackgroundResource(R.mipmap.level_three);
                break;
            case 3:
                head.setBackgroundResource(R.mipmap.level_four);
                break;
            case 4:
                head.setBackgroundResource(R.mipmap.level_five);
                break;
            case 5:
                head.setBackgroundResource(R.mipmap.level_six);
                break;
            case 6:
                head.setBackgroundResource(R.mipmap.level_seven);
                break;
            default:
                head.setBackgroundResource(R.mipmap.level_one);
        }
    }

    public static void setEvaluate(TextView name, LinearLayout evaluate, int count, Context context){
        switch (count){
            case 0:
                evaluate.setBackgroundResource(R.drawable.shape_evaluate_green);
                name.setTextColor(context.getResources().getColor(R.color.color_green));
                break;
            case 1:
                evaluate.setBackgroundResource(R.drawable.shape_evaluate_purple);
                name.setTextColor(context.getResources().getColor(R.color.color_purple));
                break;
            case 2:
                evaluate.setBackgroundResource(R.drawable.shape_evaluate_red);
                name.setTextColor(context.getResources().getColor(R.color.color_pink));
                break;
            case 3:
                evaluate.setBackgroundResource(R.drawable.shape_evaluate_blue);
                name.setTextColor(context.getResources().getColor(R.color.color_blue));
                break;
            default:
                evaluate.setBackgroundResource(R.drawable.shape_evaluate_orange);
                name.setTextColor(context.getResources().getColor(R.color.orange_home));
        }
    }
}
